////////////////////////////////////////////////////////////////////////////////
// Copyright 2007 CORE Solutions Limited
// All rights reserved.
// PROPRIETARY AND CONFIDENTIAL INFORMATION.
// Use is subject to license terms.
//
// FUNCTION ID      :   POPUP_CATALOG_TREE
// AUTHOR           :   Saint Peng 
// DATE CREATE      :   2007/04/05
// DESCRIPTION      :   a FORM file for the function, POPUP_CATALOG_TREE
//                  :   
//                  :   
//                  :   
//
// MODIFICATION HISTORY:
// DATE         AUTHOR          VERSION NO.         COMMENT
// -----------  --------------  ------------------  -------------------
// 2007/04/05   Saint Peng      1.0                 source is generated.
//
//
//
////////////////////////////////////////////////////////////////////////////////

package com.erp.app.catalog.catalogTreePopup.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import com.erp.framework.controller.form.SimplePageEditStyleForm;

/**
* <p>A <strong>PageEditForm</strong> is a JavaBean which provides property
* getter and setter methods for all of the bean properties, and implements
* <code>Serializable</code>, as required by the JavaBean specification
* The main purpose for this bean is to get the user search criteria input
* and to get the user input from the web browsers.
* from the web browsers.
* As the name implies, it will only handle one-page-edit documents.
*
* @author          Saint Peng 
* @version 1.0     2007/04/05
* @since           FrameWork 1.0
*
*/
public class PopupCatalogTreeForm extends SimplePageEditStyleForm {

	//Attributes (DB Table Name: T_POPUP_CATALOG_TREE)
	private String[] nodeId;                         //DB Column Name: NODE_ID
	private String[] description;                    //DB Column Name: DESCRIPTION
	private String[] catalogLevel;                   //DB Column Name: CATALOG_LEVEL
	private String[] createCompanyCode;              //DB Column Name: CREATE_COMPANY_CODE
	private String[] waterMark;                      //DB Column Name: WATER_MARK
	private String[] browser;                        //DB Column Name: BROWSER
	private String[] level1NodeId;                   //DB Column Name: LEVEL_1_NODE_ID
	private String[] level2NodeId;                   //DB Column Name: LEVEL_2_NODE_ID
	private String[] level3NodeId;                   //DB Column Name: LEVEL_3_NODE_ID
	private String[] parentNodeId;

	//Searching Criteria Attributes (DB Table Name: T_POPUP_CATALOG_TREE)
	private String srchCompanyCode;                  //DB Column Name: COMPANY_CODE
	private String srchHdrStatus;                    //DB Column Name: STATUS
	private String srchNodeIdFr;                     //DB Column Name: NODE_ID
	private String srchNodeIdTo;                     //DB Column Name: NODE_ID
	private String srchDescriptionFr;                //DB Column Name: DESCRIPTION
	private String srchDescriptionTo;                //DB Column Name: DESCRIPTION
	private String srchCatalogLevelFr;               //DB Column Name: CATALOG_LEVEL
	private String srchCatalogLevelTo;               //DB Column Name: CATALOG_LEVEL
	private String srchCreateCompanyCodeFr;          //DB Column Name: CREATE_COMPANY_CODE
	private String srchCreateCompanyCodeTo;          //DB Column Name: CREATE_COMPANY_CODE
	private String srchWaterMarkFr;                  //DB Column Name: WATER_MARK
	private String srchWaterMarkTo;                  //DB Column Name: WATER_MARK
	
	private boolean trueSetParent = false;
	private boolean falseSetParent = false;
	private boolean trueSetChild = false;
	private boolean falseSetChild = false;
	private boolean needChild = false;


//	The following classes can be used to access common utilities,
//	delegate methods, and common validation functions.
//	private PopupCatalogTreeCommonUtil util = new PopupCatalogTreeCommonUtil();
//	private PopupCatalogTreeCommonDelegate dg = new PopupCatalogTreeCommonDelegate();
	private PopupCatalogTreeCommonValidator validator = new PopupCatalogTreeCommonValidator();

	/**
	* Converts to a string representing the data in this object.
	* A new <code>String</code> object is allocated and initialized to 
	* contain the character sequence currently represented by this 
	* object. This <code>String</code> is then returned. Subsequent 
	* changes to this object do not affect the contents of the 
	* <code>String</code>. 
	*
	* @return     a string representation of the object.
	* @see        java.lang.Object#toString()
	* @author     Saint Peng 
	* @since      Framework 1.0
	*/
	public String toString() {
		String pkStr = "PK: {srchNodeIdFr = " + this.srchNodeIdFr
			+ "\n, srchNodeIdTo = " + this.srchNodeIdTo + "}\n";

		String colStr = "COL: {srchDescriptionFr = " + this.srchDescriptionFr
			+ "\n, srchDescriptionTo = " + this.srchDescriptionTo
			+ "\n, srchCatalogLevelFr = " + this.srchCatalogLevelFr
			+ "\n, srchCatalogLevelTo = " + this.srchCatalogLevelTo
			+ "\n, srchCreateCompanyCodeFr = " + this.srchCreateCompanyCodeFr
			+ "\n, srchCreateCompanyCodeTo = " + this.srchCreateCompanyCodeTo
			+ "\n, srchWaterMarkFr = " + this.srchWaterMarkFr
			+ "\n, srchWaterMarkTo = " + this.srchWaterMarkTo + "}\n";

		String mandatoryStr = "{srchCompanyCode = " + this.srchCompanyCode
			+ "\n, srchHdrStatus = " + this.srchHdrStatus
			+ "}\n";

		return "toString() is:\n" + mandatoryStr + pkStr + colStr;
	}

	
	/**
	* Validate the properties that have been set for this non-HTTP request,
	* and return an <code>ActionErrors</code> object that encapsulates any
	* validation errors that have been found.  If no errors are found, return
	* <code>null</code> or an <code>ActionErrors</code> object with no
	* recorded error messages.
	* <p>
	* The default implementation attempts to forward to the HTTP version of
	* this method.
	*
	* @param      the action errors array
	* @author     Saint Peng 
	* @since      Framework 1.0
	*/
	public void otherValidate(ActionErrors errors) {

		validator.validateSave(errors, this);
	}

	/**
	* Validate the properties that have been set for this non-HTTP request,
	* and return an <code>ActionErrors</code> object that encapsulates any
	* validation errors that have been found.  If no errors are found, return
	* <code>null</code> or an <code>ActionErrors</code> object with no
	* recorded error messages.
	* <p>
	* The default implementation attempts to forward to the HTTP version of
	* this method.
	*
	* @param      mapping      the action mapping
	* @param      formIn       the action form
	* @param      request      the http request
	* @param      response     the http response
	* @param      errors       the action errors array
	* @author     Saint Peng 
	* @since      Framework 1.0
	*/
	public void moreValidate(ActionMapping mapping, ActionForm formIn,
		HttpServletRequest request, HttpServletResponse response, ActionErrors errors) {

		validator.moreValidateSave(mapping, formIn, request, response, errors);
	}

	/**
	* Validate the properties that have been set for this non-HTTP request,
	* and return an <code>ActionErrors</code> object that encapsulates any
	* validation errors that have been found.  If no errors are found, return
	* <code>null</code> or an <code>ActionErrors</code> object with no
	* recorded error messages.
	* <p>
	* The default implementation attempts to forward to the HTTP version of
	* this method.
	*
	* @param      the action errors array
	* @author     Saint Peng 
	* @since      Framework 1.0
	*/
	public void validateSearch(ActionErrors errors) {

		validator.validateSearch(errors, this);
	}

	/**
	* Validate the properties that have been set for this non-HTTP request,
	* and return an <code>ActionErrors</code> object that encapsulates any
	* validation errors that have been found.  If no errors are found, return
	* <code>null</code> or an <code>ActionErrors</code> object with no
	* recorded error messages.
	* <p>
	* The default implementation attempts to forward to the HTTP version of
	* this method.
	*
	* @param      mapping      the action mapping
	* @param      formIn       the action form
	* @param      request      the http request
	* @param      response     the http response
	* @param      errors       the action errors array
	* @author     Saint Peng 
	* @since      Framework 1.0
	*/
	public void moreValidateSearch(ActionMapping mapping, ActionForm formIn,
		HttpServletRequest request, HttpServletResponse response, ActionErrors errors) {

		validator.moreValidateSearch(mapping, formIn, request, response, errors);
	}

	/**
	* Reset all bean properties to their default state.  This method
	* is called inside the reset() method.
	*
	* @param      mapping The mapping used to select this instance
	* @param      request The servlet request we are processing
	* @author     Saint Peng 
	* @since      Framework 1.0
	*/
	public void otherReset(ActionMapping mapping, HttpServletRequest request) {

		setRowMode(null);
		setIdx(null);
		//companyCode = null;
		//srchCompanyCode = null;
	}

	////////////////////////////////////////////////////////////////////////////////
	//Generated Accessors (get/set methods) for Table (PopupCatalogTree)
	////////////////////////////////////////////////////////////////////////////////

	public String[] getNodeId() {
		return this.nodeId;
	}

	public String[] getDescription() {
		return this.description;
	}

	public String[] getCatalogLevel() {
		return this.catalogLevel;
	}

	public String[] getCreateCompanyCode() {
		return this.createCompanyCode;
	}

	public String[] getWaterMark() {
		return this.waterMark;
	}

	public String[] getBrowser() {
		return this.browser;
	}

	public String[] getLevel1NodeId() {
		return this.level1NodeId;
	}

	public String[] getLevel2NodeId() {
		return this.level2NodeId;
	}

	public String[] getLevel3NodeId() {
		return this.level3NodeId;
	}

	public void setNodeId(String[] nodeId) {
		this.nodeId = nodeId;
	}

	public void setDescription(String[] description) {
		this.description = description;
	}

	public void setCatalogLevel(String[] catalogLevel) {
		this.catalogLevel = catalogLevel;
	}

	public void setCreateCompanyCode(String[] createCompanyCode) {
		this.createCompanyCode = createCompanyCode;
	}

	public void setWaterMark(String[] waterMark) {
		this.waterMark = waterMark;
	}

	public void setBrowser(String[] browser) {
		this.browser = browser;
	}

	public void setLevel1NodeId(String[] level1NodeId) {
		this.level1NodeId = level1NodeId;
	}

	public void setLevel2NodeId(String[] level2NodeId) {
		this.level2NodeId = level2NodeId;
	}

	public void setLevel3NodeId(String[] level3NodeId) {
		this.level3NodeId = level3NodeId;
	}

	////////////////////////////////////////////////////////////////////////////////
	//Generated Accessors (get/set methods) for searching criterias
	////////////////////////////////////////////////////////////////////////////////

	public String getSrchCompanyCode() {
		return this.srchCompanyCode;
	}

	public String getSrchHdrStatus() {
		return this.srchHdrStatus;
	}

	public String getSrchNodeIdFr() {
		return this.srchNodeIdFr;
	}

	public String getSrchNodeIdTo() {
		return this.srchNodeIdTo;
	}

	public String getSrchDescriptionFr() {
		return this.srchDescriptionFr;
	}

	public String getSrchDescriptionTo() {
		return this.srchDescriptionTo;
	}

	public String getSrchCatalogLevelFr() {
		return this.srchCatalogLevelFr;
	}

	public String getSrchCatalogLevelTo() {
		return this.srchCatalogLevelTo;
	}

	public String getSrchCreateCompanyCodeFr() {
		return this.srchCreateCompanyCodeFr;
	}

	public String getSrchCreateCompanyCodeTo() {
		return this.srchCreateCompanyCodeTo;
	}

	public String getSrchWaterMarkFr() {
		return this.srchWaterMarkFr;
	}

	public String getSrchWaterMarkTo() {
		return this.srchWaterMarkTo;
	}

	public void setSrchCompanyCode(String srchCompanyCode) {
		this.srchCompanyCode = srchCompanyCode;
	}

	public void setSrchHdrStatus(String srchHdrStatus) {
		this.srchHdrStatus = srchHdrStatus;
	}

	public void setSrchNodeIdFr(String srchNodeIdFr) {
		this.srchNodeIdFr = srchNodeIdFr;
	}

	public void setSrchNodeIdTo(String srchNodeIdTo) {
		this.srchNodeIdTo = srchNodeIdTo;
	}

	public void setSrchDescriptionFr(String srchDescriptionFr) {
		this.srchDescriptionFr = srchDescriptionFr;
	}

	public void setSrchDescriptionTo(String srchDescriptionTo) {
		this.srchDescriptionTo = srchDescriptionTo;
	}

	public void setSrchCatalogLevelFr(String srchCatalogLevelFr) {
		this.srchCatalogLevelFr = srchCatalogLevelFr;
	}

	public void setSrchCatalogLevelTo(String srchCatalogLevelTo) {
		this.srchCatalogLevelTo = srchCatalogLevelTo;
	}

	public void setSrchCreateCompanyCodeFr(String srchCreateCompanyCodeFr) {
		this.srchCreateCompanyCodeFr = srchCreateCompanyCodeFr;
	}

	public void setSrchCreateCompanyCodeTo(String srchCreateCompanyCodeTo) {
		this.srchCreateCompanyCodeTo = srchCreateCompanyCodeTo;
	}

	public void setSrchWaterMarkFr(String srchWaterMarkFr) {
		this.srchWaterMarkFr = srchWaterMarkFr;
	}

	public void setSrchWaterMarkTo(String srchWaterMarkTo) {
		this.srchWaterMarkTo = srchWaterMarkTo;
	}


	public String[] getParentNodeId() {
		return parentNodeId;
	}


	public void setParentNodeId(String[] parentNodeId) {
		this.parentNodeId = parentNodeId;
	}


	public boolean isFalseSetChild() {
		return falseSetChild;
	}


	public void setFalseSetChild(boolean falseSetChild) {
		this.falseSetChild = falseSetChild;
	}


	public boolean isFalseSetParent() {
		return falseSetParent;
	}


	public void setFalseSetParent(boolean falseSetParent) {
		this.falseSetParent = falseSetParent;
	}


	public boolean isNeedChild() {
		return needChild;
	}


	public void setNeedChild(boolean needChild) {
		this.needChild = needChild;
	}


	public boolean isTrueSetChild() {
		return trueSetChild;
	}


	public void setTrueSetChild(boolean trueSetChild) {
		this.trueSetChild = trueSetChild;
	}


	public boolean isTrueSetParent() {
		return trueSetParent;
	}


	public void setTrueSetParent(boolean trueSetParent) {
		this.trueSetParent = trueSetParent;
	}

	////////////////////////////////////////////////////////////////////////////////
	//Other Accessors (get/set methods)
	////////////////////////////////////////////////////////////////////////////////

    public void clearResultList() {
    	this.trueSetParent = false;
    	this.falseSetParent = false;
    	this.trueSetChild = false;
    	this.falseSetChild = false;
    	this.needChild = false;
    }


}